package com.gitee.hermer.engine.jars.core.execute.manage;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import com.gitee.hermer.engine.jars.core.execute.EngineExecuteCallable;
import com.gitee.hermer.engine.jars.core.execute.EngineExecuteRunnable;
import com.gitee.hermer.engine.jars.core.execute.domain.EngineResponseBody;
import com.gitee.hermer.engine.jars.dependent.thread.pool.callback.CallableResult;

public interface IEngineExecutePoolManager extends InitializingBean,DisposableBean{


	public <V> V execute(EngineExecuteCallable<V> runnable) throws Throwable;

	public void execute(EngineExecuteRunnable runnable) throws Throwable;

	public void executeAsyn(EngineExecuteRunnable runnable) throws Throwable;

	public <V> void executeAsyn(EngineExecuteCallable<V> runnable,CallableResult<V> callableResult) throws Throwable;

	/**
	 * JOB方式调用执行，会执行增强Sections
	 * @param projectName
	 * @param version
	 * @param workMethod
	 * @param workVersion
	 * @param finArgs
	 * @return
	 * @throws Throwable
	 */
	public <V> V execute(String projectName, String version, String workMethod,String workVersion,Object[] finArgs) throws Throwable;


}
